package com.silverbox.sweeporder.common.util;

import com.silverbox.core.util.StringUtils;
import com.silverbox.sweeporder.core.redis.RedisConstant;

public class KeyGenerateRulesUtils {
	
	 public static final String separatorA=RedisConstant.SEPARATOR1;//分隔符1；
     public static final String separatorB=RedisConstant.SEPARATOR2;//分隔符2；
     
     // 汉堡王小程序
     public static final String BKMini = "bkmini";
     // 扫码点餐
     public static final String SWEEP = "sweep";
     // 商品
     public static final String GOODS = "goods";
     // 售卖时段
     public static final String TimeInterval = "TimeInterval";
  // 售卖时段
     public static final String CreateOrder = "CreateOrder";
     // 集团
     public static final String SHOP = "p";
     // 门店
     public static final String STORE = "s";
     
     /**
      * 扫码点餐店铺商品key
      * @param shopId
      * @param storeId
      * @return
      */
     public static String generateSweepShopGoodsKey(int shopId, int storeId){
         String key = SWEEP + separatorB + GOODS + separatorB + SHOP + shopId + separatorB + STORE + storeId;
         return key;
     }
   
    /**
     * 获取预约点餐key
     * @param shopperId
     * @param storeId
     * @param date
     * @param time
     * @return
     */
    public static String getAppointmentTimeKey(String shopperId, String storeId, String date,String time){
        String key="";
        if(StringUtils.isEmpty(shopperId)||StringUtils.isEmpty(storeId)||StringUtils.isEmpty(date)){
            return null;
        }
        key = shopperId+"_"+storeId+"_"+date+"_"+time;
        return key;
    }
   
}
